function e(e, t, a) {
  return t in e ? Object.defineProperty(e, t, {
    value: a,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = a, e;
}
const app = getApp();
const util = require('../../../utils/util.js');
const applet_park_api_url = app.globalData.applet_park_api_url;
const applet_park_api_url_imgUrl = app.globalData.applet_park_api_url_imgUrl;
const {
  requestDataparams
} = require('../../../utils/request.js');

function t(e) {
  return parseInt(e) < 10 && (e = "0" + e), e;
}

var a, s = require("../../../utils/calendar.js"),
  n = getApp();

Page({
  data: (a = {
      roomId: '',
      price: 0, //租赁办公室价格
      chioceStaffId: [],
      selectedTime: 0,
      showStatus: true,
      rangeTime: [],
      staffList: [],
      currentDate: '',
      currentWeek: '',
      todayDate: '',
      nowTime: '',
      beginTime: '',
      endTime: '',
      selectedId: [],
      isContine: 'true',
      couponPrice: 0,
      couponId: '',
      clickCount: 0,
      imgUrl: applet_park_api_url_imgUrl,
      squareImg: applet_park_api_url_imgUrl + '/duihao.png',
      personListImg: applet_park_api_url_imgUrl + '/my_act.png',
      checkIcon: false,
      meetingId: '',
      background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
      indicatorDots: true,
      vertical: false,
      autoplay: false,
      circular: false,
      interval: 2000,
      duration: 500,
      previousMargin: 0,
      nextMargin: 0,
      addServesPrice: 0, //增值增值价格
      officePrice: 0, //办公室价格
      totalPrice: 0, //总价 
      addServerLists: [], //增值服务列表
      chiocePersonList: [], //参会人员列表
      conferenceOrderDetails: '',
      conferenceParticipants: '',
      mieetingTitle: '',
      meetingRoomInfo: '',
      checks: 1
    }, e(a, "errorMessage", ""), e(a, "checkMessage", !1), e(a, "dialogDate", !1), e(a, "nowDateIndex", wx.getStorageSync("nowDateIndex")),
    e(a, "topDate", wx.getStorageSync("topDate")), e(a, "date_data1", []), e(a, "date_data2", []),
    e(a, "date_now", {
      month: "",
      year: "",
      value: ""
    }), e(a, "date_next", {
      month: "",
      year: "",
      value: ""
    }), e(a, "add_btn", !0), e(a, "reduce_btn", !1), e(a, "final_num", 1), e(a, "show_a", !1),
    e(a, "selecedList", []), e(a, "saleStatus", "nothing"), e(a, "saleContent", {}),
    e(a, "imgUrl", n.globalData.KrImgUrl), e(a, "cardStatus", "nothing"), e(a, "cardLength", 0),
    e(a, "discount", !1), e(a, "originalAmount", 0), a),

  changeProperty: function (e) {
    var propertyName = e.currentTarget.dataset.propertyName
    var newData = {}
    newData[propertyName] = e.detail.value
    this.setData(newData)
  },
  changeIndicatorDots: function (e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function (e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function (e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function (e) {
    this.setData({
      duration: e.detail.value
    })
  },
  toPreDay: function (e) { //前一天
    var that = this;
    if (that.data.currentDate == that.data.todayDate) { //当前时间没有前一天
      that.setData({
        nowDateIndex: 0,
        selectedTime: [],
        selectedId: [],
        totalPrice: 0,
        nextTime: that.data.nowTime
      })
      wx.showToast({
        title: '没有前一天',
        icon: 'none'
      })

      //that.getTime(nextDay,that.data.nowTime);//获取时间列表
    } else { //有前一天
      var dateTime = that.data.currentDate;
      var dd = new Date(dateTime);
      dd.setDate(dd.getDate() - 1);
      var y = dd.getFullYear();
      var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
      var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
      var weekArr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
      var week = weekArr[dd.getDay()];
      var nextDay = y + "-" + m + "-" + d;
      that.setData({
        currentDate: nextDay,
        currentWeek: week,
        selectedTime: [],
        selectedId: [],
        nowDateIndex: 1,
        totalPrice: 0,
        nextTime: '00:00',
      })
      that.getTime(nextDay, '00:00'); //获取时间列表
    }

  },
  toNextDay: function (e) { //下一天
    var that = this;
    var dateTime = that.data.currentDate;
    var dd = new Date(dateTime);
    dd.setDate(dd.getDate() + 1);
    var y = dd.getFullYear();
    var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
    var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
    var weekArr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
    var week = weekArr[dd.getDay()];
    var nextDay = y + "-" + m + "-" + d;
    that.setData({
      currentDate: nextDay,
      currentWeek: week,
      selectedTime: [],
      selectedId: [],
      totalPrice: 0,
      nextTime: '00:00',
    })
    that.getTime(nextDay, '00:00');
  },
  getNowRangeTime: function () {
    var e = this.data.detailInfo.meetingRoomId,
      t = this,
      a = [],
      n = [];
    wx.showLoading({
      title: "加载中"
    });
    var i = new Date(),
      s = 2 * i.getHours() + 1 + (i.getMinutes() > 29 ? 1 : 0),
      r = this.data.selectedTime;
    o.getRequest({
      url: o.globalData.KrUrl + "api/gateway/krmting/room/disableTime",
      methods: "GET",
      data: {
        date: t.data.orderDate.time,
        meetingRoomId: e
      },
      header: {
        "content-type": "appication/json"
      },
      success: function (e) {
        a = e.data.data.disableTime;
        for (var i = 19; i < 49; i++) {
          var o = {
            disabled: !1,
            number: i,
            actived: !1
          };
          n.push(o);
        }
        n.forEach(function (e, n) {
          a.indexOf(e.number) > -1 && (e.disabled = !0), "今天" == t.data.orderDate.timeText && e.number < s && (e.disabled = !0),
            r.indexOf(e.number) > -1 && (e.actived = !0);
        }), t.setData({
          rangeTime1: n.slice(0, 8),
          rangeTime2: n.slice(8, 16),
          rangeTime3: n.slice(16, 24),
          rangeTime4: n.slice(24),
          rangeTime: n
        }, function () {
          wx.hideLoading();
        });
      }
    });
  },
  getThemeName: function (e) {
    var t = e.time.split("-"),
      a = "" + t[1] + t[2] + "会议";
    this.setData({
      orderDate: e,
      themeName: a
    }), this.choose_date = e.time;
  },
  dealDateList: function () {
    var e = this.data.nowDate,
      t = this.data.topDate,
      a = "";
    t.map(function (t) {
      t.date === e && (a = t.type);
    });
    var n = this;
    n.james = new i.dateData({
      btn_bool: !0,
      data: t,
      init_data: {
        last_btn_num: e,
        last_data: a
      }
    }), this.setData({
      date_data1: n.james.date_data1,
      date_data2: n.james.date_data2
    });
  },
  dateBtn: function (e) {
    this.james.dateBtn(e);
    var t = this.james.getValue();
    this.setData({
      date_data1: this.date_data1,
      date_data2: this.date_data2,
      selecedList: t
    });
  },
  onLoad: function (options) {
    // wx.clearStorageSync("addServerLists");
    // wx.clearStorageSync("chiocePersonList");
    var that = this;
    var curdate = that.getNowFormatDate().substring(0, 10);
    var curtime = that.getNowFormatDate().substring(11, 16);
    var nowTime = options.dateCurrentStr == curdate ? curtime : '00:00'
    that.setData({
      price: options.price,
      roomId: options.roomId,
      currentDate: options.dateCurrentStr,
      todayDate: curdate, //获取当前日期 
      nowTime: nowTime, //获取当前日期 
    })
    that.getcurrentWeek(that.data.currentDate); //获取当前周几
    that.getTime(that.data.currentDate, that.data.nowTime); //获取会议室时间表
    that.getMeetingRoomInfo(); //初始化获取数据
    //that.getMemberList();
    //清除缓存
    that.roomId = options.roomId
  },
  getMemberList() { //获取员工
    var that = this;
    var userId = wx.getStorageSync("id");
    wx.request({
      url: applet_park_api_url + '/api/enterpriseStaffs',
      method: 'GET',
      data: {
        enterpriseId: 30
      },
      success(res) {
        if (res.data.code == 0) {
          var datas = res.data.data;
          for (var i = 0; i < datas.length; i++) {
            datas[i]['chioceStatue'] = true;
          }
          that.setData({
            staffList: datas
          })
        } else {
          wx.showToast({
            title: '网络异常',
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })
  },
  getMeetingRoomInfo() { //初始化获取会议室数据
    var that = this;
    var url = applet_park_api_url_imgUrl;
    wx.request({
      url: applet_park_api_url + '/api/conferenceRooms/' + that.data.roomId,
      method: 'GET',
      data: {},
      success(res) {
        if (res.data.code == 0) {
          var meetingRoomInfo = res.data.data;
          var price = res.data.data.price;
          that.setData({
            price: price
          })
          var imagesList = res.data.data.images.split(',');
          for (var i = 0; i < imagesList.length; i++) {
            if ((imagesList[i] == '') || (imagesList[i] == undefined)) {
              imagesList.splice(i, 1);
            } else {
              imagesList[i] = url + '/' + imagesList[i];
            }
          }
          res.data.data.images = imagesList;
          that.setData({
            meetingId: meetingRoomInfo.roomId, //会议室id
            meetingRoomInfo: meetingRoomInfo
          })
        } else {
          wx.showToast({
            title: '网络异常',
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })
  },
  getNowFormatDate() { //获取当前日期
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
    var strDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var getHours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
    var getMinutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
    var getSeconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
      " " + getHours + seperator2 + getMinutes +
      seperator2 + getSeconds;
    return currentdate;
  },
  getcurrentWeek(date) { //获取当前周几
    date = date + " 00:00:00";
    var show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六');
    date = new Date(date);
    var day = date.getDay();
    let week = show_day[day];
    this.setData({
      currentWeek: week
    })
  },

  getTime(data, nowTime) { //获取会议室时间表
    var that = this;
    wx.request({
      url: applet_park_api_url + '/api/conferenceRooms/scheduleTime',
      method: 'GET',
      data: {
        renewal: false,
        id: that.data.roomId,
        day: data,
        renewalDate: data + ' ' + nowTime + ':00',
      },
      success(res) {
        if (res.data.code == 0) {
          var timeList = res.data.data;
          var result = [];
          for (var i = 0; i < timeList.length; i += 8) {
            result.push(timeList.slice(i, i + 8));
          }
          that.setData({
            rangeTime: result,
            rowLength: result.length
          })
        } else {
          wx.showToast({
            title: '网络异常',
          })
        }


      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })

  },
  enterCoupon() { //跳转优惠券
    //foreignType优惠券类型
    //foreignId会议室id
    var that = this;
    wx.navigateTo({
      url: "../../../pages/coupon_canteen/coupon_canteen?foreignType=2&foreignId=" + that.data.meetingId
    });
  },
  enterMember() { //跳转增值服务
    var that = this;
    wx.navigateTo({
      url: '../memberList/memberList',
    })
  },
  heider: function (e) {
    "wrapper" == e.target.dataset.wrapper && this.setData({
      show_a: !0
    });
  },
  onShow: function () {
    this.data.price_all;
  },
  onHide() {
    //清除缓存
    this.setData({
      totalPrice: this.data.officePrice,
      addServesPrice: 0,
    })
  },
  getSeatcalculate: function () {
    var e = this.data,
      t = this,
      a = {
        quantity: e.sankeNum,
        seatGoodIds: this.seatGoodIds
      };
    if (e.cardContent.id && (a.cardId = e.cardContent.id), e.saleContent.couponId && (a.couponId = e.saleContent.couponId),
      this.seatGoodIds) {
      var s = this.data.totalAmount;
      wx.getStorage({
        key: "seat_amount",
        success: function (e) {
          e.data.totalAmount && (s = e.data.totalAmount);
        }
      }), n.getRequest({
        url: n.globalData.KrUrl + "api/gateway/kmorder/seat/calculate",
        methods: "GET",
        data: a,
        success: function (a) {
          var n = a.data.data,
            o = {},
            i = (t.data.cardStatus, t.data.saleStatus, {});
          if (1 == a.data.code) {
            n.cardId && (o = {
              cardName: n.cardName,
              remainAmountDecimal: n.cardDeductAmount,
              id: n.cardId
            }), n.couponId && (i = {
              couponId: n.couponId,
              amount: n.couponAmount
            }), t.isFirst = n.first || t.isFirst;
            var r = {
              totalAmount: n.totalAmount
            };
            wx.setStorage({
              key: "seat_amount",
              data: r
            }), t.setData({
              cardContent: o,
              saleContent: i,
              price_all: n.totalAmount,
              discount: n.discount,
              originalAmount: n.originalAmount
            });
          } else -5 == a.data.code ? (t.setData({
            price_all: s
          }), t.clearCard(e.sankeNum), t.setErrorMessage(a.data.message)) : -4 == a.data.code ? (t.setData({
            price_all: s
          }), t.clearSale(e.sankeNum), t.setErrorMessage(a.data.message)) : (t.setData({
            price_all: s
          }), t.setErrorMessage(a.data.message), t.getSaleContent(t.data.sankeNum));
        },
        fail: function (e) {
          t.setErrorMessage(e.data.message);
        }
      });
    }
  },
  setErrorMessage: function (e) {
    var t = this;
    this.setData({
      showError: !1,
      errorMessage: e
    }, function () {
      setTimeout(function () {
        t.setData({
          showError: !0,
          errorMessage: ""
        });
      }, 2e3);
    });
  },
  onUnload: function () {
    this.setData({
      carendarArr: {}
    });
  },
  setSaleStorage: function (e) {
    wx.getStorage({
      key: "seat_sale_info",
      success: function (t) {
        var a = t.data;
        "sale" == e ? a.sale = !1 : a.card = !1, wx.setStorage({
          key: "seat_sale_info",
          data: a
        });
      }
    });
  },
  tapTime: function (e) { //选择时间
    var that = this;
    var nowIdArray = [];
    var nowTimeArray = [];
    var checkId = e.currentTarget.dataset.index;
    var checkTime = e.currentTarget.dataset.time;
    var timeState = e.currentTarget.dataset.state;
    //判断时间是否已经选过
    if (!timeState) {
      return false;
    }
    var checkIdArray = that.data.selectedId; //被选中时间的id
    var selectedTimeArray = that.data.selectedTime;
    if (checkIdArray.length > 0) {
      nowIdArray = nowIdArray.sort();
      var index = checkIdArray.indexOf(checkId);
      var lastNum = checkIdArray[checkIdArray.length - 1];
      var firstNum = checkIdArray[0];
      if (index >= 0) { //存在
        var nowContinue = that.isContinuityNum(nowIdArray); //返回是否连续
        if (nowContinue == true) {
          if ((lastNum == checkId) || (firstNum == checkId)) {
            that.judgeIcon(checkId, false);
            checkIdArray.splice(index, 1);
            that.setData({
              selectedId: checkIdArray
            })
          } else {
            wx: wx.showToast({
              title: '请选择连续的时间',
              icon: 'none',
              duration: 1000,
            })
          }
        }
      } else { //不存在
        nowIdArray = checkIdArray.concat(checkId);
        var nowContinue = that.isContinuityNum(nowIdArray); //返回是否连续
        if (nowContinue == true) {
          checkIdArray = nowIdArray;
          that.judgeIcon(checkId, true);
          that.setData({
            selectedId: checkIdArray,
          })
        } else {
          wx: wx.showToast({
            title: '请选择连续的时间',
            icon: 'none',
            duration: 1000,
          })
        }
      }
    } else {
      checkIdArray = checkIdArray.concat(checkId);
      that.judgeIcon(checkId, true);
      that.setData({
        selectedId: checkIdArray,
      })
    }
    //处理时间
    var TimeList = that.data.rangeTime;
    for (var i = 0; i < that.data.selectedId.length; i++) {
      for (var j = 0; j < TimeList.length; j++) {
        var TimeItem = TimeList[j];
        for (var a = 0; a < TimeItem.length; a++) {
          if (that.data.selectedId[i] == TimeItem[a].timeId) {
            nowTimeArray = nowTimeArray.concat(TimeItem[a].time);
          }
        }
      }
    }
    that.setData({
      selectedTime: nowTimeArray
    })
    //判断时间区间  先找出开始时间和结束时间
    that.handleTimeSection(that.data.selectedTime);
  },
  judgeIcon(checkId, iconState) { //判断icon显示
    var that = this;
    var TimeList = that.data.rangeTime;
    for (var i = 0; i < TimeList.length; i++) {
      var TimeItem = TimeList[i];
      for (var j = 0; j < TimeItem.length; j++) {
        if (checkId == TimeItem[j].timeId) {
          TimeItem[j].activity = iconState;
        }
      }
    }
    that.setData({
      rangeTime: TimeList
    })

  },
  isContinuityNum(num) { //判断是时间否连续
    var that = this;
    var number = that.handArray(num);
    num = number
    let array = [];
    if (num instanceof Array) {
      array = [...num];
    } else {
      array = Array.from(num.toString()) //转换为数组
    }
    var i = array[0];
    var isContinuation = true;
    for (var e in array) {
      if (array[e] != i) {
        isContinuation = false;
        break;
      }
      i++;
    }
    return isContinuation;
  },
  handArray(num) {
    var number = [];
    for (var i = 0; i < num.length; i++) { //字符串数组转数字
      number = number.concat(parseInt(num[i]));
    }
    //数组按照从小到大排序
    var tmp = 0;
    for (var i = 0; i < number.length; i++) {
      for (var j = 0; j < number.length - i - 1; j++) {
        if (number[j] > number[j + 1]) {
          tmp = number[j + 1];
          number[j + 1] = number[j];
          number[j] = tmp;
        }
      }
    }
    return number
  },

  judgeRepeat(checkTime, selectedTimeArray) { //判断选中的日期是否存在
    var that = this;
    for (var i = 0; i < selectedTimeArray.length; i++) {
      var index = selectedTimeArray.indexOf(checkTime);
      if (index > -1) {
        selectedTimeArray.splice(index, 1); //存在就删除
      } else {
        that.setData({
          selectedTime: selectedTimeArray.concat(checkTime),
        })
      }
    }

  },
  handleTimeSection(section) { //先找出开始时间和结束时间
    var that = this;
    var maxTime = ''; //最大的时间
    var minTime = ''; //初始时间
    var newSection = [];
    for (var i = 0; i < section.length; i++) {
      newSection = newSection.concat(that.data.currentDate + " " + section[i]);
    }
    //sort按时间正序排序
    newSection = newSection.sort();
    maxTime = newSection[newSection.length - 1];
    minTime = newSection[0];
    that.handleTime(maxTime, minTime)
  },
  handleTime(val, minTime) { //处理开始时间 和结束时间
    var that = this;
    var val = val + ':00';
    var sdate1 = new Date(val.replace(/-/g, '/'));
    sdate1.setMinutes(sdate1.getMinutes() + 30);
    var nowHours = sdate1.getHours() > 9 ? sdate1.getHours().toString() : '0' + sdate1.getHours();
    var nowMinutes = sdate1.getMinutes() > 9 ? sdate1.getMinutes().toString() : '0' + sdate1.getMinutes();
    var now = nowHours + ":" + nowMinutes;
    var endtime = that.data.currentDate + " " + now;
    that.setData({
      beginTime: minTime,
      endTime: endtime
    })
    that.TimeDifference(minTime, endtime);
  },
  TimeDifference(time1, time2) {
    var that = this;
    if (time1 > time2) {
      return false;
    }
    if ((time1 != undefined) && (time2 != undefined)) {
      var begin1 = time1.substr(0, 10).split("-");
      var end1 = time2.substr(0, 10).split("-");
      var date2 = new Date(end1[1] + '/' + end1[2] + '/' + end1[0]);
      var date1 = new Date(begin1[1] + '/' + begin1[2] + '/' + begin1[0]);
      var m = parseInt(Math.abs(date2 - date1) / 1000 / 60);
      var min1 = parseInt(time1.substr(11, 2)) * 60 + parseInt(time1.substr(14, 2));
      var min2 = parseInt(time2.substr(11, 2)) * 60 + parseInt(time2.substr(14, 2));
      var n = min2 - min1;
      var minutes = m + n;
      var selectedTime = minutes / 60;
      var officePrice = parseFloat(selectedTime) * parseFloat(that.data.price);
      var totalPrice = parseFloat(officePrice) + parseFloat(that.data.addServesPrice);
      that.setData({
        officePrice: officePrice,
        totalPrice: totalPrice
      })
    } else {
      var totalPrice = 0 + parseFloat(that.data.addServesPrice) - parseFloat(that.data.couponPrice);
      that.setData({
        officePrice: 0,
        totalPrice: totalPrice
      })
    }
  },
  actionHide: function () {
    var that = this;
    that.setData({
      showStatus: true,
    });
  },
  judgeAction() { //判断费用详情未打开
    var that = this;
    var showStatus = that.data.showStatus;
    if (showStatus) { //费用详情未打开
      that.actionShow()
    } else {
      that.actionHide();
    }
  },
  actionShow: function () {
    var that = this;
    that.setData({
      showStatus: false,
    });
  },
  gostaffList() { //进入员工列表
    wx.navigateTo({
      url: '../staffList/staffList',
    })
  },
  inputEdit(e) { //验证会议主题
    var that = this;
    var value = e.detail.value;
    that.setData({
      mieetingTitle: value
    })
  },
  pay() { //会议室支付
    let that = this;
    if (that.data.checks != 1) {
      wx.showToast({
        title: '请先勾选协议',
        icon: 'none'
      })
      return false
    }
    if (that.data.beginTime == undefined || that.data.beginTime == '') {
      wx.showToast({
        title: '请选择时段',
        icon: 'none'
      })
      return false
    }
    if ((that.data.mieetingTitle == undefined) || (that.data.mieetingTitle == '')) {
      wx.showToast({
        title: '请输入会议主题',
        icon: 'none'
      })
      return false
    }
    
    var totlaPrice = that.data.totalPrice + '00';
    var beginTime = that.data.beginTime + ':00';
    var endTime = that.data.endTime + ':00';
    var TOKEN = app.globalData.TOKEN || wx.getStorageSync('TOKEN');
    var openId = app.globalData.openId || wx.getStorageSync('OPENID');
    wx.request({
      url: applet_park_api_url + '/api/wechatPay/conference',
      method: 'POST',
      header: {
        Authorization: TOKEN,
        'Content-Type': "application/x-www-form-urlencoded",
      },
      data: {
        totalAmount: totlaPrice,
        couponId: that.data.couponId, //优惠券ID
        conferenceRoomId: that.roomId, //会议室ID
        title: that.data.mieetingTitle, //标题
        appointmentStartTime: beginTime, //预约开始时间
        appointmentEndTime: endTime, //
        conferenceParticipants: that.data.conferenceParticipants, //人员ID
        conferenceOrderDetails: that.data.conferenceOrderDetails, // 增值服务
        openid: openId,
        status: 1
      },
      success(res2) {
        if (res2.data.code == 0) {
          wx.requestPayment({
            timeStamp: res2.data.data.timeStamp,
            nonceStr: res2.data.data.nonceStr,
            package: res2.data.data.prepay_id,
            signType: 'MD5',
            paySign: res2.data.data.sign,
            paySource: 1,
            success(res) {
              wx.showToast({
                title: '支付成功',
              })
              setTimeout(function () {
                wx.showToast({
                  title: '页面跳转中',
                })
                wx.navigateTo({
                  url: '../MeetingOrderlist/MeetingOrderlist',
                })
              }, 500);
            },
            fail(res3) {}
          })

        } else {
          wx.showToast({
            title: '网络异常',
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })

  },
  goserice() { //跳转增值服务
    var that = this;
    var pageName = 'meetingliat'
    wx.navigateTo({
      url: '../addServes/addServes?totalPrice=' + that.data.totlaPrice + '&pageName=' + pageName,
    })
  },
  getAddServer() { //获取增值服务
    var that = this;
    var addServerLists = wx.getStorageSync('chioceList');
    var price = parseFloat(that.data.officePrice) + parseFloat(that.data.addServesPrice) - parseFloat(that.data.couponPrice);
    that.setData({
      addServerLists: addServerLists,
      totalPrice: price
    })
  },
  personList() { //获取参会人员
    var that = this;
    var chiocePersonList = wx.getStorageSync('chiocePersonList');
    var staffList = that.data.staffList;
    // for(var i=0;i<staffList.length;i++){
    //   for(var j=0;j<chiocePersonList.length;j++){
    //      if(chiocePersonList[j].id == staffList[i].id){
    //        staffList[i].chioceStatue = false;
    //      }
    //   }
    // }
    that.setData({
      chiocePersonList: chiocePersonList
    })
  },
  checkboxChange(e) { //checkbox协议是否勾选 
    var that = this;
    if (e.detail.value == '') {
      //表示未选中
      that.setData({
        checks: 0
      })
    } else {
      //表示选中状态
      that.setData({
        checks: 1
      })
    }
    
  },

});